﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LocalizedSample
{
    public class LocalizationBase <T, TL>: ILocalizable<T, TL> where TL:Localization<T>, new()
    {
        public LocalizationBase()
        {
            Localizations = new LocalizationSet<T, TL>();
        }
        public virtual LocalizationSet<T, TL> Localizations { get; set; }

        [NotMapped]
        public TL this[int lcid]
        {
            get
            {
                return Localizations[lcid];
            }
            set
            {
                Localizations[lcid] = value;
            }
        }
    }
}
